stage.set_background("winter")
sprite = codesters.Sprite("person12")
sprite.go_to(-125, -150)
frosty = codesters.Sprite("snowman")
frosty.go_to(-100 ,-50)
t = codesters.Teacher()
try:
tval1 = frosty.get_x()
tval1b = frosty.get_y()
except:
tval1 = "DNE"
tval1b = "DNE"
t1 = TestObjective()
t1.add_success(tval1 == 100, "Great Job!")
t1.add_failure(tval1 == -100, "Did you change the x-coordinate in the Go To command?")
t1.add_failure(tval1 == "DNE", "Did you delete or rename frosty?")
t1.add_creative(tval1 != 100 and tval1b != -125 and tval1 != -100 and tval1b != -50, "That's a good spot for frosty as well!")
t2 = TestObjective()
t2.add_success(tval1b == -125, "Great job!")
t2.add_failure(tval1b == -50, "Did you change the y-coordinate in the Go To command?")
tester = TestManager()
tester.add_test_list([t1, t2])
tester.run_tests()
tester.display_first_feedback()
-
Run Code
-
Activity Submitted!
Submit Work
-
Next Activity
-
Stop Running Code
-
Show Chart
-
Show Console
-
Reset Code Editor
-
Codesters How To (opens in a new tab)